import Layout from "@/layout/index.vue";

const modules = import.meta.glob('@/views/**/*.vue')


export const menuView = [
    {
        keyWord: 'recommend',
        title: '为我推荐',
    }, {
        keyWord: 'sift',
        title: '云音乐精选',
    },
]
const routes = menuView.map(item => ({
    name: item.keyWord.split('-').map(item => item[0].toUpperCase() + item.slice(1)).join(),
    path: `/${item.keyWord}`,
    component: modules[`/src/views/${item.keyWord}/index.vue`],
    meta: {
        title: item.title,
        icon: item.keyWord
    }
}))
export default [
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: '/recommend',
        children: [
            ...routes,
            {
                path: '/theme',
                name: 'Theme',
                component: () => import('@/views/theme/index.vue'),
                meta: {
                    title: '主题'
                }
            },
        ]
    }
]
